(1) Field of the Invention
The present invention relates to a system for dynamically changing a logical data structure of a database.
Use of a database in various services has increased. An on-line system by which a large amount of data in the database is updated and managed has become more popular. For example, a database for a large number of accounts of customers in banking service, a database for personal management in various corporations, a database for stock management of parts and products in manufacturing industries, a database for sales/stock management of commodities in services and sales, and the like, have been used.
There is a type of database among various databases as described above in which a record (referred to as an owner record) is related to other records (each of them is referred to as a member record) in a network structure (including a hierarchy structure and a tree structure). This type of database is referred to as a network type database, and has been applied to various databases. In the network type database, data representing each member record related to an owner record has been managed in an area having a fixed length.
(2) Description of the Related Art
FIG. 1 shows an example of a process for changing a logical structure of the conventional network type database.
Referring to FIG. 1, a logical data structure (1) of an original database is defined. This database is the network type database, and has records classified into two types of records: an owner record and a member record. Owner-member gets are formed among the records, and an owner-member relationship may be defined between arbitrary records. In the logical data structure (1) of the network type data base, a record type B and a record type C each of which is defined as the member record type are linked to a record type A which is defined as the owner record type in the owner-member relationship (similar to the tree structure). This type of database is physically stored, for example, in a storage unit such as a DASD (Direct Access Storage Device: e.g. a magnetic disk device). The database having the logical data structure (1) is stored in the storage unit with a physical data structure as shown in FIG. 1(a).
In the case (a), respective records (a record having data a1, a record having data a2, . . . ) which belong to the record type A defined as the owner record type have set-pointers indicated by hatching. Each of the set-pointers identifies a position of each of records belonging to the record type B and/or the record type C. That is, a record having data a1 (this record is referred to as a record a1 and the same in the other case) have a set-pointer .alpha. of a member record b1 and a set-pointer .beta. of a member record c2 added as control data to the leading portion thereof. The set-pointers .alpha. and .beta. are generally named as set-information, and the set-pointers .alpha. and .beta. are respectively referred to as an .alpha. set and a .beta. set. The set-information (.alpha.,.beta.) included in the record a1 belonging to the record type A is managed in an area having a fixed length, set information for the other records a2, a3 etc. are managed in areas the same as that for the record a1. The respective records b1 and c1 are also provided with control data as shown by hatching.
Conventionally, in a case where a record type D is added to the logical data structure (1) shown in FIG. 1 so that the logical data structure is changed (or extended), the following process is performed conventionally.
The record type D is additionally defined in the logical data structure as shown in (2) so that the logical data structure (1) is changed to a new logical data structure (3). After the new logical data structure is defined, an operation for changing the physical structure of the database is carried out. In this case, since the set-information provided as the control data in respective owner records is managed in the area having the fixed length, it is impossible to extend the database without changing the area for the current database.
Thus, a backup is made of all of the records in the database stored in the storage unit as shown by (a), so that the data in all the records in the database is stored in a backup storage medium (e) such as a magnetic tape. The logical data structure is then changed as indicated by (c), so that the new logical data structure as shown by (3) is determined. After this, all the records are restored in the storage unit such as the DASD as indicated by (d). At this time, a process for adding record D information (including .GAMMA. set-information) is carried out.
As a result, a storage area of data d1 belonging to a record type D is provided in the database as shown by (f), a pointer .GAMMA. a pointer (a .GAMMA. set indicating the storage area of the data d1 is added to the control data of the record a1, and a reconstitution process of the database is carried out. The above process is carried out with respect to all the records a1, a2, a3, . . . included in the database shown by (a). In the above process, since each of the record pointers .alpha., .beta. and the like has fixed length, an area of each of the records belonging to the owner record type A must be extended to add the new record pointer (.GAMMA.) thereto. The extension of the area for the record pointer in one record affects storage areas of all the succeeding records (a2, a3, . . . ). Thus, the reconstitution process for all the records is needed.
As has been described, in a case where the logical data structure of the conventional network type database, the backup of all the records is made, and all the backup records are then restored in the storage unit. When all the backup records are restored, the set-information of the new record type D is added to each of the owner records.
However, in a case where the above the reconstitution process is carried out in the system of the database having a large amount of data of the owner records, a large capacity of the backup storage medium is needed, further the long process time is required for the reconstitution process.
For example, in a case of a database used to for manage accounts of customers in a bank, record type A, record type B, and record type C are respectively assigned to names of customers, ordinary deposit accounts and fixed deposit accounts. In this case, the database may be provided with records, shown by (a) in FIG. 1, for millions of customers if the scale of a bank is large. When the logical data structure of such a database is changed as shown by (3) in FIG. 1 to provide a new type of account in the database, a large amount of magnetic tape used as the backup storage medium is needed, and the reconstitution process in which the set-information having the fixed length must be changed takes a large process time, for example, a few hours in a small scale bank, and a few days in a large scale bank.
Thus, to change the logical data structure of the database, a banking service must be interrupted. That is, in a case where the database is used in the on-line banking service, a period of time for which the database can be changed is restricted. The same problem occurs in the large scale database for personal management, the data base for stock management of parts, and other databases.